<html>
<head><meta charset="utf-8"><title>how to invoke miri? · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20to.20invoke.20miri.3F.html">how to invoke miri?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="203975539"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20to%20invoke%20miri%3F/near/203975539" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jason Hu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20to.20invoke.20miri.3F.html#203975539">(Jul 15 2020 at 16:03)</a>:</h4>
<p>I am wondering whether we can invoke miri in the middle of MIR inside of a compiler? </p>
<p>the current problem I am facing is that I would like to capture the panic string whenever some panic function is called. however, sometimes the argument passed in might not be a string constant, but some local. I would like to obtain a string of the local at the best effort. is there a chance to achieve this?</p>



<a name="203981932"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20to%20invoke%20miri%3F/near/203981932" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20to.20invoke.20miri.3F.html#203981932">(Jul 15 2020 at 16:53)</a>:</h4>
<p><span class="user-mention" data-user-id="320010">@Jason Hu</span> hmm, does the local refer to a string constant? you might just need constprop</p>



<a name="204143112"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20to%20invoke%20miri%3F/near/204143112" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jason Hu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20to.20invoke.20miri.3F.html#204143112">(Jul 16 2020 at 21:07)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119009">eddyb</span> <a href="#narrow/stream/122651-general/topic/how.20to.20invoke.20miri.3F/near/203981932">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="320010">Jason Hu</span> hmm, does the local refer to a string constant? you might just need constprop</p>
</blockquote>
<p>yes that indeed is constant propagation. how should I proceed?</p>



<a name="204149872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20to%20invoke%20miri%3F/near/204149872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20to.20invoke.20miri.3F.html#204149872">(Jul 16 2020 at 22:11)</a>:</h4>
<p><span class="user-mention" data-user-id="320010">@Jason Hu</span> you shouldn't have to do anything</p>



<a name="204149875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20to%20invoke%20miri%3F/near/204149875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20to.20invoke.20miri.3F.html#204149875">(Jul 16 2020 at 22:11)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="124288">@oli</span></p>



<a name="204149958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20to%20invoke%20miri%3F/near/204149958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20to.20invoke.20miri.3F.html#204149958">(Jul 16 2020 at 22:12)</a>:</h4>
<p><span class="user-mention" data-user-id="320010">@Jason Hu</span> but an example might be good, in case you're seeing a limitation of constprop</p>



<a name="204149978"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20to%20invoke%20miri%3F/near/204149978" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20to.20invoke.20miri.3F.html#204149978">(Jul 16 2020 at 22:12)</a>:</h4>
<p>(it should run by default, to be clear)</p>



<a name="204181083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20to%20invoke%20miri%3F/near/204181083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20to.20invoke.20miri.3F.html#204181083">(Jul 17 2020 at 08:14)</a>:</h4>
<p>you should be able to just put your optimization/mir-pass after const prop and you get most of what you're asking for. If not, open issues with repro examples and we'll have a look. Let's continue this discussion in <a class="stream" data-stream-id="189540" href="/#narrow/stream/189540-t-compiler.2Fwg-mir-opt">#t-compiler/wg-mir-opt</a></p>



<a name="204187501"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20to%20invoke%20miri%3F/near/204187501" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20to.20invoke.20miri.3F.html#204187501">(Jul 17 2020 at 09:36)</a>:</h4>
<p>IIRC <span class="user-mention" data-user-id="320010">@Jason Hu</span> is playing around with a custom backend, which shouldn't even get to see unoptimized MIR</p>



<a name="204443219"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/how%20to%20invoke%20miri%3F/near/204443219" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jason Hu <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/how.20to.20invoke.20miri.3F.html#204443219">(Jul 20 2020 at 16:18)</a>:</h4>
<p>I take <code>optimized_mir</code> so I guess the mir has been optimized. I can dig a bit but I think it's somewhere deep down in the stdlib</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>